{include file="public/head"}
<style>
    .x-body {
        min-width: 800px;
    }

    body {
        overflow-x: scroll;
    }
</style>
<body>
<div class="x-body">
    <table class="layui-table">
        <thead>
        <tr>
            <th style="width: 40px;text-align: center"></th>
            <th>公司名称</th>
            <th style="width:80px;text-align:center">账户余额</th>
            <th style="width:80px;text-align:center">手续费</th>
            <th style="width:100px;text-align:center">钱包用途</th>
            <th style="width:100px;text-align:center">公司性质</th>
            <th style="width:130px;text-align:center">操作</th>
        </thead>
        <tbody>
        <tr>
            <td style="text-align:center">1</td>
            <td>{$company.name|default='总公司'}</td>
            <td style="text-align:center">{$wallet[1]['money']|default=0}</td>
            <td style="text-align:center">{$company.fee|default=0}%</td>
            <td style="text-align:center">自用钱包</td>
            <td style="text-align:center">{$company.type == 2? '子公司':'总公司' }</td>
            <td>
                <button class="layui-btn layui-btn-xs layui-btn-normal"
                        onclick="x_admin_show('充值','recharge.html?company_id={$company.id}&type={$company.type}&purpose=1','500')">
                    充值
                </button>

                {if isset($wallet[1]['money']) && $wallet[1]['money']>0}
                <button class="layui-btn layui-btn-xs" style="background-color: #5FB878"
                        onclick="x_admin_show('支出','expense.html?company_id={$company.id}&type={$company.type}&purpose=1&money={$wallet[1]["money"]}&id={$wallet[1]["id"]}','500')">
                    支出
                </button>
                {/if}

                <button class="layui-btn layui-btn-xs layui-btn-warm"
                        onclick="x_admin_show('账单','bill.html?company_id={$company.id}&type={$company.type}&purpose=1')">
                    账单
                </button>
            </td>
        </tr>
        {if count($companys)==0}
        <tr>
            <td style="text-align:center">2</td>
            <td>{$company.name|default='总公司'}</td>
            <td style="text-align:center">{$wallet[2]['money']|default=0}</td>
            <td style="text-align:center">{$company.fee|default=0}%</td>
            <td style="text-align:center">对公钱包</td>
            <td style="text-align:center">{$company.type == 2 ? '子公司':'总公司'}</td>
            <td>
                <button class="layui-btn layui-btn-xs layui-btn-normal"
                        onclick="x_admin_show('充值','recharge.html?company_id={$company.id}&type={$company.type}&purpose=2','500')">
                    充值
                </button>
                <button class="layui-btn layui-btn-xs layui-btn-warm"
                        onclick="x_admin_show('账单','bill.html?company_id={$company.id}&type={$company.type}&purpose=2')">
                    账单
                </button>
            </td>
        </tr>
        {/if}
        {if count($companys) >0}
        {volist name="companys" id="vo"}
        <tr>
            <td style="text-align:center">{$i+2}</td>
            <td>{$vo.name}</td>
            <td style="text-align:center">{$wallets[$vo['id']]['money']|default=0}</td>
            <td style="text-align:center">{$vo.fee|default=0}%</td>
            <td style="text-align:center">对公钱包</td>
            <td style="text-align:center">子公司</td>
            <td>
                <button class="layui-btn layui-btn-xs layui-btn-normal"
                        onclick="x_admin_show('充值','recharge.html?company_id={$vo.id}&type={$vo.type}&purpose=2','500')">充值
                </button>
                {if isset($wallets[$vo['id']]['money']) && $wallets[$vo['id']]['money']>0}
                <button class="layui-btn layui-btn-xs" style="background-color: #5FB878"
                        onclick="x_admin_show('支出','expense.html?company_id={$vo.id}&type={$vo.type}&purpose=2&money={$wallets[$vo["id"]]["money"]}&id={$wallets[$vo["id"]]["id"]}','500')">
                    支出
                </button>
                {/if}
                <button class="layui-btn layui-btn-xs layui-btn-warm"
                        onclick="x_admin_show('账单','bill.html?company_id={$vo.id}&type={$vo.type}&purpose=2')">
                    账单
                </button>
            </td>
        </tr>
        {/volist}
        {/if}
        </tbody>
    </table>
</div>
</body>
{include file="public/foot"}
